<template>
  <van-card
      v-for="user in userList"
      :desc="user.profile"
      :title="user.username"
      :thumb="user.userAvatar"
  >
    <template #tags>
      <van-tag plain type="primary" v-for="tag in user.tags" style="margin: 4px">
        {{tag}}
      </van-tag>
    </template>
    <template #footer>
      <van-button size="mini">联系我</van-button>
    </template>
  </van-card>

  <van-loading v-if="loading" vertical type="spinner">
    <template #icon>
      <van-icon name="star-o"  size="30" />
    </template>
    加载中...
  </van-loading>
</template>
<script setup lang="ts">
import {UserType} from "../models/user";
import {defineProps} from "vue";

//定义接口
interface UserCardListProps{
  loading?: boolean;
  userList?: UserType[];
}

//接收父组件传递来的值defineProps<UserCardListPros>()

defineProps<UserCardListProps>()

</script>

<style scoped>

</style>